from django.db import models
from human.models import UserModel
# Create your models here.

class PListModel(models.Model):
    SELECT_CHOOSE = (
        ('0','未选中'),
        ('1','已选中')
    )
    LK_CHOOSE = (
        ('0','正常'),
        ('1','异常')
    )
    G_CHOOSE = (
        ('0','无'),
        ('1','怀孕中'),
        ('2','哺乳中'),
    )
    name = models.CharField(max_length=20,verbose_name='姓名')
    sex = models.CharField(max_length=10,verbose_name='性别')
    date = models.CharField(max_length=20,verbose_name='出生日期')
    weight = models.CharField(max_length=10,verbose_name='体重')
    allergic = models.CharField(max_length=100,verbose_name='过敏史')
    history = models.CharField(max_length=200,verbose_name='病史')
    liver = models.CharField(choices=LK_CHOOSE,max_length=10,verbose_name='肝功能')
    kidney = models.CharField(choices=LK_CHOOSE,max_length=10,verbose_name='肾功能')
    gestation = models.CharField(choices=G_CHOOSE,max_length=10,verbose_name='孕育情况')
    select = models.CharField(choices=SELECT_CHOOSE,max_length=10,verbose_name='选择',default='0',blank=True,null=True)
    user = models.ForeignKey(UserModel,max_length=10,on_delete=models.DO_NOTHING,
                             db_constraint=False,related_name='plist_user',verbose_name='用户')

    def __str__(self):
        return self.name


    class Meta:
        db_table = 'plist'
        verbose_name = '患者列表'
        verbose_name_plural = verbose_name








